package com.showtao.front.dto;

import java.io.Serializable;

import com.showtao.front.domain.Catalog;

@SuppressWarnings("serial")
public class CatalogSelectionDto implements Serializable {

    private Long id;
    private String name;
    private String alias;
    private int level = 1;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAlias() {
        return alias;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public static CatalogSelectionDto from(Catalog catalog){
        CatalogSelectionDto dto = new CatalogSelectionDto();
        dto.setId(catalog.getId());
        dto.setName(catalog.getName());
        dto.setAlias(catalog.getAlias());
        return dto;
    }
}
